
package com.mall.task.init;

import org.apache.log4j.Logger;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.mall.untils.ScheduleJob;

/**
 * 该注解保证多个任务间不会同时执行，所以在多任务执行时最好加上 
 * @DisallowConcurrentExecution
 * @author tgy
 *
 */
@DisallowConcurrentExecution
public class QuartzJobFactoryExecution implements Job {

	public final Logger log = Logger.getLogger(this.getClass());

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {

		ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
		TaskUtils.invokMethod(scheduleJob);

	}
}